package zuoye2;

public class Demo11 {


    public static void main(String[] args) {
        int sum = 1;//算2一个初始

        for (int i = 1; i <=100; i++) {//遍历1-100
            int j = 2;//从2开始除
            while (i % j != 0) {
                j++;//被除数自增
                if (i == j) {
                    sum++;
                    break;
                }
            }
        }
        System.out.println("[1,100]之间有" + sum + "个质数");
    }
}
